<template>
  <el-dialog :title="title" :visible.sync="dialogFormVisible">
    <el-form :model="form">
      <el-form-item label="V级" :label-width="formLabelWidth">
        <el-radio-group v-model="form.userLevel">
          <el-radio :label="1">v1</el-radio>
          <el-radio :label="2">v2</el-radio>
          <el-radio :label="3">v3</el-radio>
          <el-radio :label="4">v4</el-radio>
          <el-radio :label="5">v5</el-radio>
          <el-radio :label="6">v6</el-radio>
          <el-radio :label="7">v7</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="mit">取 消</el-button>
      <el-button type="primary" @click="onSubmit">确 定</el-button>
    </div>
  </el-dialog>
</template>
<script>
import {uselevel} from "@/api/user/user"
export default {
  data() {
    return{
      title:'设置V级',
      dialogFormVisible:false,
      formLabelWidth: '120px',
      options: [],
      form: {
        userLevel:'1',
        userid: undefined
      },
    }
  },
  methods:{
    async onSubmit(){
      await uselevel(this.form)
      this.$message({
        type: 'success',
        message: '修改成功'
      });
      this.$emit('success')
      this.dialogFormVisible = false
      this.setForm()
    },
    setForm(){
      this.form.userLevel=1
      this.form.userid = undefined
    },
    open(obj){
      this.form.userid = obj.userid
      this.form.userLevel = obj.userLevel
      this.dialogFormVisible = true
      this.getissueCardList()
    },
    mit(){
      this.dialogFormVisible = false
      this.setForm()
    }
  }
}
</script>
<style scoped lang="scss">

</style>
